package http

import (
	cfg "git.huoys.com/middle-end/kratos/pkg/net/http/config"
	kgin "git.huoys.com/middle-end/kratos/pkg/net/http/gin"
	xtime "git.huoys.com/middle-end/kratos/pkg/time"
	pb "gitee.com/rzttw/grpc/api"
	"github.com/gin-gonic/gin"
	"time"
)

var svc pb.DemoServer

// New new a bm server.
func New(s pb.DemoServer) (engine *gin.Engine, err error) {
	cf := &cfg.ServerConfig{
		Addr:         "0.0.0.0:8000",
		Timeout: xtime.Duration(time.Second*2),
	}
	svc = s
	engine = kgin.DefaultServer(cf)
	pb.RegisterDemoGinServer(engine, s)
	kgin.Start(engine)
	return
}


